import type { StudentCourseList, StudentCourseRecommendParams, StudentCourseRecommendResponse, StudentIdParams, StudentProfile, StudentStudyPreCheckParams, StudentUnitList, StudentUnitParams, StudentUnitStageRequestParams, StudentUnitStageResponse, StudentWordListRequestParams, StudentWordListResponse, StudentWordReviewContent, StudentWordReviewRecommendParams, StudentWordReviewRecommendResponse, StudentWordReviewStudyRequestParams, StudentWordShorthandPostStudyResponse, StudentWordShorthandStudyParams } from '@/api/types/student'
import { http } from '../request'

// 学生 API
export const studentApi = {
  // 获取单元阶段
  getUnitStage(params: StudentUnitStageRequestParams) {
    return http.post<StudentUnitStageResponse>('/api/tapi/student/course/unit/study-info', params)
  },
  // 获取学生单元列表
  getStudentUnitList(params: StudentUnitParams) {
    return http.post<StudentUnitList>('/api/tapi/student/course/unit/list', params)
  },
  // 获取学生单词列表
  getStudentWordList(params: StudentWordListRequestParams) {
    return http.post<StudentWordListResponse>('/api/tapi/student/course/word/list', params)
  },
  // 获取学生课程列表
  getStudentCourseList(params: StudentIdParams) {
    return http.post<StudentCourseList>('/api/tapi/student/course/list', params)
  },
  // 获取学生个人信息
  getStudentProfile(params: StudentIdParams) {
    return http.post<StudentProfile>('/api/tapi/student/profile', params)
  },
  // 复习学习
  reviewStudy(params: StudentWordReviewRecommendParams) {
    return http.post('/api/tapi/student/word/review/study', params)
  },
  // 学前检查
  preStudy(params: StudentStudyPreCheckParams) {
    return http.post('/api/tapi/student/word/review/pre-study', params)
  },
  // 学后检查
  postReviewStudy(params: StudentWordReviewStudyRequestParams) {
    return http.post<StudentWordShorthandPostStudyResponse>('/api/tapi/student/word/review/post-study', params)
  },
  // 获取推荐单词
  getCourseRecommend(params: StudentCourseRecommendParams) {
    return http.post<StudentCourseRecommendResponse>('/api/tapi/student/course/recommend', params)
  },
  // 获取学习内容
  getReviewStudyContent(params: StudentWordListRequestParams) {
    return http.post<StudentWordReviewContent>('/api/tapi/student/word/review/content', params)
  },
  // 单词识记学习
  shorthandStudy(params: StudentWordShorthandStudyParams) {
    return http.post('/api/tapi/student/word/shorthand/study', params)
  },
  // 单词识记学前检查
  shorthandPreStudy(params: StudentStudyPreCheckParams) {
    return http.post('/api/tapi/student/word/shorthand/pre-study', params)
  },
  // 单词识记学后检查
  shorthandPostStudy(params: StudentWordReviewStudyRequestParams) {
    return http.post<StudentWordShorthandPostStudyResponse>('/api/tapi/student/word/shorthand/post-study', params)
  },
  // 单词识记获取学习内容
  shorthandGetStudyContent(params: StudentWordListRequestParams) {
    return http.post('/api/tapi/student/word/shorthand/content', params)
  },
  // 单词复习
  getWordReviewRecommend(params: StudentIdParams) {
    return http.post<StudentWordReviewRecommendResponse>('/api/tapi/student/word/review/recommend', params)
  },
}
